package com.sgj.factory.absfactory.pizzastore.order;

import com.sgj.factory.absfactory.pizzastore.pizza.LDChesssePizza;
import com.sgj.factory.absfactory.pizzastore.pizza.LDPepperPizza;
import com.sgj.factory.absfactory.pizzastore.pizza.Pizza;

/**
 * 抽象工厂模式
 * @Author: Guoji Shen
 * @Date: 2021/11/12 10:04
 */
public class LDFactory implements AbsFactory{

    @Override
    public Pizza createPizza(String orderType) {
        Pizza pizza = null;
        if (orderType.equalsIgnoreCase("cheese")) {
            pizza = new LDChesssePizza();
        } else if (orderType.equalsIgnoreCase("pepper")) {
            pizza = new LDPepperPizza();
        }
        return pizza;
    }
}